import LayerManager from "./LayerManager";
import LayerInterface from "./LayerInterface";

export default class SingleManager extends LayerManager {



    pushView(view: LayerInterface) {
        this.popView(null)
        this.list.push(view);
        // let node: Laya.View = layerInfo.getLayer()
        view.setOrder(this.zOrder);
        this.root.addChild(view.getNode())

    }

    popView(view: LayerInterface) {
        if (this.list.length > 0) {
            let layerInfo = this.list.shift();
            layerInfo.exit();
            return true;
        } else {
            return false;
        }

    }

}